package com.financial.service.heemoney.controller.split;

import com.financial.service.heemoney.dto.inparameter.HeemoneyPaySplitInParamDTO;
import com.financial.service.heemoney.dto.inparameter.HeemoneyPaySplitQueryInParamDTO;
import com.financial.service.heemoney.service.FinancialPaysplitHeemoneyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @api {post}
 * @apiExample author zhaopengjun
 * tar  汇收银付款分账业务
 * date   2020/3/19 11:23
 * @apiGroup
 * @apiVersion 1.0.0
 * @apiHeader
 * @apiParam
 * @apiSuccess
 */
@RestController
@RequestMapping("/heemoneyPaySplit")
public class HeemoneyPaySplitController {
    @Autowired
    private FinancialPaysplitHeemoneyService financialPaysplitHeemoneyService;

    @PostMapping("/paySplit")
    public Map<String, Object> paySplit(@RequestParam HeemoneyPaySplitInParamDTO heemoneyPaySplitInParamDTO ) {
        return financialPaysplitHeemoneyService.paySplit(heemoneyPaySplitInParamDTO);
    }

    @PostMapping("/splitAsyn")
    public Map<String, Object> paySplit(@RequestParam String str ) {
        return financialPaysplitHeemoneyService.splitAsyn(str);
    }

    @PostMapping("/splitQuery")
    public Map<String, Object> splitQuery(@RequestParam HeemoneyPaySplitQueryInParamDTO heemoneyPaySplitQueryInParamDTO) {
        return financialPaysplitHeemoneyService.splitQuery(heemoneyPaySplitQueryInParamDTO);
    }

    /**
    * @Author zhaopengjun
    * @Description //TODO 根据商户号查询付款分账金额 ---满500元免收收付费 不足500元手续费按0.5一笔计算
    * @Date 11:15 2020/3/31
    * @Param [storeNo]
    * @return java.util.Map<java.lang.String,java.lang.Object>
    **/
    @PostMapping("/queryMoney")
    public Map<String, Object> queryMoney(@RequestParam String storeNo) {
        return financialPaysplitHeemoneyService.queryMoney(storeNo);
    }
}
